Optimal. Leaf size=25 \[ \frac{1}{2} a \sin ^2(x)+\frac{b x}{2}-\frac{1}{2} b \sin (x) \cos (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.026968, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.417, Rules used = {3089, 2564, 30, 2635, 8} \[ \frac{1}{2} a \sin ^2(x)+\frac{b x}{2}-\frac{1}{2} b \sin (x) \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3089
Rule 2564
Rule 30
Rule 2635
Rule 8
Rubi steps
\begin{align*} \int \sin (x) (a \cos (x)+b \sin (x)) \, dx &=\int \left (a \cos (x) \sin (x)+b \sin ^2(x)\right ) \, dx\\ &=a \int \cos (x) \sin (x) \, dx+b \int \sin ^2(x) \, dx\\ &=-\frac{1}{2} b \cos (x) \sin (x)+a \operatorname{Subst}(\int x \, dx,x,\sin (x))+\frac{1}{2} b \int 1 \, dx\\ &=\frac{b x}{2}-\frac{1}{2} b \cos (x) \sin (x)+\frac{1}{2} a \sin ^2(x)\\ \end{align*}
Mathematica [A] time = 0.0040089, size = 25, normalized size = 1. \[ -\frac{1}{2} a \cos ^2(x)+\frac{b x}{2}-\frac{1}{4} b \sin (2 x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.018, size = 21, normalized size = 0.8 \begin{align*} b \left ( -{\frac{\cos \left ( x \right ) \sin \left ( x \right ) }{2}}+{\frac{x}{2}} \right ) -{\frac{ \left ( \cos \left ( x \right ) \right ) ^{2}a}{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.09505, size = 28, normalized size = 1.12 \begin{align*} -\frac{1}{2} \, a \cos \left (x\right )^{2} + \frac{1}{4} \, b{\left (2 \, x - \sin \left (2 \, x\right )\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.472956, size = 66, normalized size = 2.64 \begin{align*} -\frac{1}{2} \, a \cos \left (x\right )^{2} - \frac{1}{2} \, b \cos \left (x\right ) \sin \left (x\right ) + \frac{1}{2} \, b x \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.204378, size = 37, normalized size = 1.48 \begin{align*} - \frac{a \cos ^{2}{\left (x \right )}}{2} + \frac{b x \sin ^{2}{\left (x \right )}}{2} + \frac{b x \cos ^{2}{\left (x \right )}}{2} - \frac{b \sin{\left (x \right )} \cos{\left (x \right )}}{2} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.11448, size = 26, normalized size = 1.04 \begin{align*} \frac{1}{2} \, b x - \frac{1}{4} \, a \cos \left (2 \, x\right ) - \frac{1}{4} \, b \sin \left (2 \, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]